#ifndef _TOOL_H
#define _TOOL_H
#include "VSObject.h"
#include "global.h"
#include "imageloader.h"

class Tool
{
public:
	enum TopMenu{NONE,CREATE,GRAVITY,COLOR,MERGE,Cube,Sphere,Disk,Person,OK};
	Tool(void);
	Tool(VSObject obj);
	~Tool(void);

public:
	int SelectSonTool(Point3D pos);
	void Render();
	void AddSon(Tool son);
	bool SelectTool(Point3D pos);
	bool getBounding(){return m_bBounding;}
	Tool setType(TopMenu type,int texID,Image* img);
	Tool setType(TopMenu type);
	int getType(){return m_type;}
	void clearBounding();
	void setBounding(bool b){m_bBounding = b;}
	void setBounding(int sonIdx,bool b);

private:
	void renderSelf();
	void renderSon();
	void renderCreatebox();
	void renderColorbox();
	void renderGravitybox();
	void renderMergebox();
	void renderCubebox();
	void renderSpherebox();
	void renderDiskbox();
	void renderOKbox();

private:
	VSObject m_object;
	bool m_bBounding;
	int m_boundingbox[4];
	std::vector<Tool> m_toolson;
	TopMenu m_type;
	int m_texID;
	Image* m_img;
};

#endif